<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/studentTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                >

    <ui:define name="content1">
        <div class="col-6 col-sm-6 col-lg-6">
            <script type="text/javascript" src="../../ckeditor/ckeditor.js"></script>
            <h:form id="form" enctype="multipart/form-data" >

                <div class="form-group">
                    <div class="col-2">Title</div>
                    <div class="input-group ">
                        <span class="input-group-addon">@</span>
                        <!--<input type="text" class="form-control" placeholder="Full name" />-->
                        <h:inputText value="#{mailComposer.title}" styleClass="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-2">To</div>
                    <div class="input-group ">
                        <span class="input-group-addon">@</span>
                        <!--<input type="text" class="form-control" placeholder="Full name" />-->
                        <h:inputText value="#{mailComposer.receiverString}" styleClass="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="input-group ">
                        <h:inputTextarea id="textarea" class="editor" value="#{mailComposer.content}" />
                        <script type="text/javascript">
                            //<![CDATA[
                            CKEDITOR.replace('form:textarea');
                            //]]>
                        </script>
                    </div>

                </div>
                <div class="form-group">
                    <p:fileUpload fileUploadListener="#{mailComposer.upload}" mode="advanced" dragDropSupport="false"  
                                  update="messages1" sizeLimit="1000000"  allowTypes="/(\.|\/)(gif|jpe?g|png)$/" />  

                    <p:growl id="messages1" showDetail="true"/> 
                </div>
                <p>Choose files to attach (not larger than 5MB per file ): </p>
                <div class="form-group">

                </div>

                <div class="form-group">
                    <h:commandButton id="submitButton" styleClass="btn btn-default" value="Send"  action="#{mailComposer.send}"
                                     />  

                </div>

            </h:form> 


        </div>

    </ui:define>

</ui:composition>
